<template>
  <div class="page_main">
    <ul class="vp_list">
      <li v-for="(item, index) in viewpointList" @click="goDetail(item.point_id, item)" :key="index">
        <div class="avat_box">
          <img class="avat_img" :src="item.face_image_small" width="30" height="30" />
          <span class="avat_name">{{ item.name }}</span>
        </div>
        <dl class="vp_intro">
          <dt>
            <span class="vp_is_pay" v-if="item.point_type == '1'">付费</span>
            {{ item.point_name }}
          </dt>
          <dd>{{ item.point_desc }}</dd>
        </dl>
        <p class="vp_operate">
          <span class="vp_zan fr" :class="{ vp_zan_on: item.like_status == '1' }">{{ item.like_num }}</span>
          <span class="vp_time">{{ item.create_time }}</span>
        </p>
      </li>
    </ul>
  </div>
</template>

<script>
import { queryViewpointList } from '@/service/yewuServer'
export default {
  name: 'viewpoint',
  data() {
    return {
      curPage: 1,
      viewpointList: [],
    }
  },
  computed: {
    curpagekey() {
      return this.$route.query.key
    },
  },
  created() {
    queryViewpointList(
      {
        curPage: this.curPage,
        numPerPage: 3,
      },
      { encode: true },
    ).then(
      res => {
        if (res.error_no == '0') {
          this.viewpointList = res.results[0].data
        } else {
          // Vue.$vux.tast.show({
          // 	txt: err.error_info
          // })
        }
      },
      err => {
        console.log(err)
        // Vue.$vux.tast.show({
        // 	txt: err.error_info
        // })
      },
    )
  },
  mounted() {},
  methods: {
    pageBack() {
      this.$router.go(-1)
    },
    goDetail(pointId, curPonit) {
      this.$store.commit('updateCurTougu', curPonit)
      this.$router.push({ path: '/viewpointDetail/' + pointId })
      // this.$router.push({name: 'viewpointDetail', params: {
      // 	pointId: pointId
      // }})
    },
  },
  destroyed() {},
}
</script>

<style></style>
